Skip to content

Conversation

kyleknap
Copy link
Collaborator

This builds off of the tests in this PR: #501 that asserted adlfs user agents are set for SDK clients. Even though the user agent tests added some coverage to how adlfs connected to SDK coverage, the adlfs test suite lacked coverage for how adlfs configurations were proxied to SDK clients (e.g., which account url to use and what credentials to set). By having these tests, it will make it easier to correctly do refactorings related to client creation (e.g., this PR: #504) and easier to add support new SDK client configurations in the future.

In addition to add these tests, a bug was discovered where for SAS token authentication on the file-like object, it would not respect location mode, while the file system did. The logic in the file-like object was updated to be consistent with files system logic since SAS tokens can be reused for secondary endpoints.

This builds off of the tests that asserted adlfs user agents are set
for SDK clients. Even though the user agent tests added some coverage
to how adlfs connected to SDK coverage, the adlfs test suite lacked
coverage for how adlfs configurations were proxied to SDK clients
(e.g., which account url to use and what credentials to set). By
having these tests, it will make it easier to correctly refactorings
related to client creation and easier to add support new SDK client
configurations in the future.

In addition to add these tests, a bug was discovered where for SAS
token authentication on the file-like object, it would not respect
location mode, while the file system did. The logic in the file-like
object was updated to be consistent with files system logic.
call_kwargs["credential"] = credential
if location_mode is not None:
call_kwargs["_location_mode"] = location_mode
if user_agent is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user agent is never none, does there need to be an if statement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good callout. I mainly did it out of symmetry with the other kwargs and we could leverage that if we ever add the ability to update the user agent in adlfs. But we don't today so we can always set it in the expected call.

@kyleknap
Copy link
Collaborator Author

@martindurant this one should be good to review as well. It is mainly adding test cases around client creation and fixing an edge case that was found because of the new tests.

@martindurant martindurant merged commit fb580fe into fsspec:main Jul 30, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants